<template>
    <div class="yousport-star-list">
        <div class="page-navbar">
            <ysPraiseCell class="yousport-praisecell" ></ysPraiseCell>
        </div>

    </div>
</template>

<script>
    import ysPraiseCell from '../component/ys-praisecell.vue'
    import ysNavbar from '../component/ys-navbar.vue'
    import bridge from '../bridge'
    import util from '../assets/util'

    export default {

        data() {
            return {
            };
        },
        activated(){
            this.initHeader();
            this.resumeScroll();
        },
        beforeRouteLeave(to, from, next){
            var scrollTop = document.querySelector('.page-infinite-wrapper').scrollTop;
            if(scrollTop) {
                util.session.set('praise-list-scroll', scrollTop);
            }

            next();
        },
        methods:{
            resumeScroll() {
                var scrollTop = util.session.get('praise-list-scroll');
                if(scrollTop) {
                    document.querySelector('.page-infinite-wrapper').scrollTop = scrollTop;
                }

            },
            initHeader() {
                bridge.client.configNavBar(function () {

                }, {centerItems:[{title:'为我点赞的'}],rightItems:[]});
            },
        },
        components:{
            ysPraiseCell , ysNavbar
        }
    };
</script>

<style>
    .yousport-praisecell {
        background-color: #fff;
    }
</style>
